load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "distsql",
    srcs = ["server.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/distsql",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/gossip",
        "//pkg/kv",
        "//pkg/roachpb",
        "//pkg/server/telemetry",
        "//pkg/sql/catalog/catsessiondata",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/colflow",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfra/execopnode",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/faketreeeval",
        "//pkg/sql/flowinfra",
        "//pkg/sql/rowflow",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondata",
        "//pkg/sql/sessiondatapb",
        "//pkg/sql/sqltelemetry",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/pprofutil",
        "//pkg/util/timeutil",
        "//pkg/util/tochar",
        "//pkg/util/tracing",
        "//pkg/util/tracing/grpcinterceptor",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "distsql_test",
    size = "large",
    srcs = [
        "columnar_operators_test.go",
        "columnar_utils_test.go",
        "inbound_test.go",
        "main_test.go",
        "setup_flow_after_drain_test.go",
        "vectorized_panic_propagation_test.go",
    ],
    embed = [":distsql"],
    exec_properties = select({
        "//build/toolchains:is_heavy": {"test.Pool": "large"},
        "//conditions:default": {"test.Pool": "default"},
    }),
    deps = [
        "//pkg/base",
        "//pkg/col/coldata",
        "//pkg/col/coldataext",
        "//pkg/col/typeconv",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/rpc/nodedialer",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/colcontainer",
        "//pkg/sql/colexec",
        "//pkg/sql/colexec/colbuilder",
        "//pkg/sql/colexec/colexecagg",
        "//pkg/sql/colexec/colexecargs",
        "//pkg/sql/colexec/colexectestutils",
        "//pkg/sql/colexec/colexecwindow",
        "//pkg/sql/colexecop",
        "//pkg/sql/colflow",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfra/execagg",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/flowinfra",
        "//pkg/sql/randgen",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowexec",
        "//pkg/sql/sem/builtins/builtinsregistry",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/storage",
        "//pkg/testutils",
        "//pkg/testutils/distsqlutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/testcluster",
        "//pkg/util",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/netutil",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
